<!DOCTYPE html>
<html>
<head>


    <script src="dsbridge.js" type="text/javascript"></script>
</head>
<body>

<p>调用原生Toast</p>
<button onclick="showToast()">弹提示</button>
<p>获取getOaid</p>
<button onclick="getOaid()">获取oaid</button>
<p>设置安装后删除 0为不删，1为删</p>
<button  onclick="setIsInstallApkDelete()">设置安装后删除</button>

<p>获取当前安装后删除状态 0为不删，1为删</p>
<button  onclick="getIsInstallApkDelete()">获取当前安装后删除状态</button>


<p>设置下载自动安装 0为不装，1为装</p>
<button  onclick="setIsAutoInstallApk()">设置下载自动安装</button>

<p>获取下载自动安装 0为不装，1为装</p>
<button  onclick="getIsAutoInstallApk()">获取当前安装后删除状态</button>


<p>添加下载任务1</p>
<button  onclick="addDownloadTask1()">添加下载任务1</button>

<p>添加下载任务2</p>
<button  onclick="addDownloadTask2()">添加下载任务2</button>


<p>保存数据到本地，参数 key   value</p>
<button  onclick="saveStringToLocal()">保存数据到本地</button>

<p>获取保存数据到本地，参数 key  value（value是默认值，如果本地没有，将返回默认值）</p>
<button  onclick="getStringFromLocal()">获取保存数据到本地</button>


<p>关闭应用</p>
<button  onclick="exit()">关闭应用</button>


<p>分享</p>
<button  onclick="share()">分享</button>

<p>获取图片</p>
<button  onclick="getPhoto()">获取图片</button>
<p>getTest</p>
<button  onclick="getTest()">getTest</button>
<p>getTest2</p>
<button  onclick="getTest2()">getTest2</button>
<p>test3</p>
<button  onclick="test3()">test3</button>
<p>sendPhoto</p>
<button  onclick="sendPhoto()">sendPhoto</button>

<script>
function getPhoto(){

   LaomiGameApi.getPhoto("3479791518","13770511352029924248","84950b4bfb0968904afafa7ee960c2c0");

};

var LaomiGameCallBack = {

  test3 : function(result) {

     console.log(result.isShowProgressTips)
     result.success('123')

  },
  test2 : function() {

     console.log('LaomiGameCallBack test2')
     LaomiGameApi.showToast('LaomiGameCallBack test2');

  },
  test : function() {

     console.log('LaomiGameCallBacktest')
     LaomiGameApi.Test3('test2()');

  }
};
function test2(){
    console.log('test2 window')


};

function test3(){
    console.log('function test3kkkkk')
    //异步调用
    dsBridge.call("test3","test3kkkkk", function (v) {
        alert(v);
    })
}

function getTest(){
    console.log('getTest')
    LaomiGameCallBack.test3({
    localId: '',
    isShowProgressTips: 1,
    success: function (res) {
        console.log('res neibu')
        var serverId = res.serverId; // 返回图片的服务器端ID
    }
    });

};
function sendPhoto(){

   var k=LaomiGameApi.sendPhoto('2833691742','4324572915192199079','17082fd618fd5807150bbf1695c6653','LaomiGameCallBack.test()');
     console.log('上传 结果：' + k);
};


function getTest2(){

   LaomiGameCallBack.test();

};

function share(){

   LaomiGameApi.shareText("123");

};

function exit(){

   LaomiGameApi.exit();

};
function getOaid(){

   var k=LaomiGameApi.getOaid();

   LaomiGameApi.showToast(k);
};

function showToast(){
    LaomiGameApi.showToast('nihao');
};

function setIsInstallApkDelete(){
    LaomiGameApi.setIsInstallApkDelete(1);
};

function getIsInstallApkDelete(){


    console.log('getIsInstallApkDelete')

   var k= LaomiGameApi.getIsInstallApkDelete();
    LaomiGameApi.showToast(k);
};

function setIsAutoInstallApk(){
    LaomiGameApi.setIsAutoInstallApk(1);
};

function getIsAutoInstallApk(){

    console.log('getIsAutoInstallApk')
    var k=LaomiGameApi.getIsAutoInstallApk();
    LaomiGameApi.showToast(k);
};


function saveStringToLocal(){
    LaomiGameApi.saveStringToLocal('spassword','123456');
};

function getStringFromLocal(){


   var k= LaomiGameApi.getStringFromLocal('spassword','111111');
    LaomiGameApi.showToast(k);
};

function addDownloadTask1(){


    LaomiGameApi.addDownloadTask("1524","王者修仙","http://d.apps.yayawan.com/apk/yjxxwzxxyyw/0610yjxx001.apk","https://att.yayawan.com/upload/2019/12/05/f3c1eb17eb.png?imageView2/1/w/250/h/250");;

};
function addDownloadTask2(){


    LaomiGameApi.addDownloadTask("1525","三国塔防","http://d.apps.yayawan.com/apk/tfsgztf/0729dfsgc001.apk","https://att.yayawan.com/upload/2020/06/16/0809232527.png?imageView2/1/w/250/h/250");

};


</script>
</body>
</html>
